package demo;

import java.util.Scanner;

public class Java_main {
    public static void main(String[] args) {
        //创建一个movies类型的数组
        Movies[] movies= new Movies[4];
        //创建4个电影对象，分别存储到movies数组中
        movies[0] = new Movies(1,"水门桥", 38.9, 9.8, "徐克", "吴京","12万人想看");
        movies[1] = new Movies(2, "出拳吧", 39, 7.8, "唐晓白", "田雨","3.5万人想看");
        movies[2] = new Movies(3,"月球陨落", 42, 7.9, "罗兰", "贝瑞","17.9万人想看");
        movies[3] = new Movies(4,"一点就到家", 35, 8.7, "许宏宇", "刘昊然","10.8万人想看");
        //.创建一个电影操作类的对象，对其进行业务处理
        Operater op = new Operater(movies);
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("==电影信息系统==");
            System.out.println("1、查看全部电影信息");
            System.out.println("2、根据id查询某个电影的详细信息展示");
            System.out.println("请您输入操作命令");
            int cmd= sc.nextInt();
            switch (cmd){
                case 1:
                    op.Print();
                    break;
                case 2:
                    System.out.println("请您输入需要查询电影的id：");
                    int id = sc.nextInt();
                    op.Show(id);
                    break;
                case 0:
                    System.out.println("退出系统~~~");
                    break;

                default:
                    System.out.println("您输入的命令有误~~");
            }
        }
    }
}
